package com.hmt.pharmacy.config.exception;

import com.hmt.pharmacy.api.result.R;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 *  @author: huza
 *  @createTime: 2025/1/31
 */
@RestControllerAdvice
public class GlobalException {

    @ExceptionHandler(value = {Exception.class})
    public R exception(Exception e) {
        e.printStackTrace();
        return R.fail(e.getMessage());
    }
}
